Skip to content

Store Token Activity in a bounded SQLite cache - #39

Closed
thrr87 wants to merge 6 commits into
mainfrom
codex/sqlite-local-activity-store
Closed

Store Token Activity in a bounded SQLite cache#39
thrr87 wants to merge 6 commits into
mainfrom
codex/sqlite-local-activity-store

Conversation

@thrr87

@thrr87 thrr87 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

What changed

  • keep Usage remaining as the default view and skip local rollout scans there
  • import Token Activity into a local SQLite store only when the user opens it
  • query bounded time ranges and filters instead of keeping full history in memory
  • stream large rollout records and deduplicate resumed and forked task counters
  • keep the existing usage-history sync unchanged

Measured on real data

  • about 20 GB of rollout files
  • cold import: about 6m39s
  • import RSS: about 106–122 MB
  • warm launch: about 2s and 111 MB RSS
  • SQLite: 13 MB plus a 5 MB WAL
  • 20,019-record restore test: about 419 ms and under 10 MB added RSS

Checks

  • swift test: 549 tests, 1 skipped, 0 failures
  • full-screen QA passed
  • default Usage remaining view creates no local activity database

Scope

Usage per token, concurrency, receipts, and insights stay deferred. Cross-Mac Token Activity sync is tracked in #38 and blocks release acceptance for #36. Do not merge or release this draft until that gate passes.

@thrr87

thrr87 commented Jul 30, 2026

Copy link
Copy Markdown
Owner Author

Closing this draft after the App Server pivot in #41. The branch remains available as research for #40, but the lightweight core will use account/usage/read and will not ship the local SQLite import path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant